<%@page import="com.lynn.salary.entity.User_"%>
<%@page import="com.opensymphony.xwork2.util.ValueStack"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
	String submitUrl = "";
	String inputValue = "";
	ValueStack vs = (ValueStack)request.getAttribute("struts.valueStack");
	User_ editEmp = (User_)vs.findValue("employee");
	String flag = vs.findString("flag");
	if(flag!=null&&flag.equals("showEditPage")) {
		submitUrl = basePath + "employee!edit.do?flag=update&employee.id="+editEmp.getId();
		
	} else {
		submitUrl = basePath + "employee!save.do";
	
	}
%>
<div class="pageContent">
	<form method="post" action="<%=submitUrl %>" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
	
	<div class="pageFormContent" layoutH="56">
	      <p>
				<label>编号：</label>
				<input name="employee.id" type="text" size="30"  value="<s:property value='employee.id' />" readonly/ >
			</p>
			<p>
				<label>姓名：</label>
				<input name="employee.name" class="required" type="text" size="30"  value="<s:property value='employee.name' />" alt="请输入客户名称"/ >
			</p>
			<p>
				<label>性别：</label>
				<%   

				 	String man = editEmp.getGender().equals("男")?"checked='checked'":"";
					String woman = editEmp.getGender().equals("女")?"checked='checked'":"";
				%>
			<input type="radio" name="employee.gender" value="男" <%=man%>>男
            <input type="radio" name="employee.gender" value="女" <%=woman%>>女

					
			</p>
			<p>
				<label>出生日期：</label>
				<input type="text" name="employee.birthday" class="date" size="30" value="<s:property value='employee.birthday' />"/><a class="inputDateButton" href="javascript:;">选择</a>
			</p>
				<p>
				<label>民族：</label>
				<s:select name="employee.nationality" list="nationalitys" listKey="code" listValue="name"></s:select>
			</p>
			<p>
				<label>电话号码：</label>
				<input type="text" name="employee.telephone" class="phone" size="30" value="<s:property value='employee.idCard' />"/>
			
			</p>
			<p>
				<label>身份证号：</label>
				<input name="employee.idCard" class="required" type="text" size="30" value="<s:property value='employee.idCard' />" alt="请输入身份证号"/>
			</p>
			<p>
				<label>部门名称：</label>
				<s:select name="employee.departmentId" list="departments" listKey="code" listValue="name"></s:select>
			</p>
			<p>
				<label>岗位：</label>
				<s:select name="employee.position" list="positions" listKey="code" listValue="name"></s:select>
		
			</p>
			<p>
				<label>入职日期：</label>
				<input type="text" name="employee.entryDate" class="date" size="30" value="<s:property value='employee.entryDate' />"/><a class="inputDateButton" href="javascript:;">选择</a>
			</p>
			<p>
				<label>离职日期：</label>
				<input type="text" name="employee.leaveDate" class="date" size="30" value="<s:property value='employee.leaveDate' />"/><a class="inputDateButton" href="javascript:;">选择</a>
			</p>
		<p>
				<label>初始密码</label>
			<input name="employee.password" class="required" type="text" size="30" value="<s:property value='employee.password' />" alt=""/>
			</p>
			<p>
				<label>薪酬标准：</label>
				<s:select name="employee.salaryStandard" list="salarystandards" listKey="id" listValue="name"></s:select>
					
			</p>
			<p>
				<label>职务：</label>
				<s:select name="employee.post" list="posts" listKey="code" listValue="name"></s:select>
		
			</p>
			<p>
				<label>员工状态：</label>
				<s:select list="#{'1':'在职','2':'离退'}"  listKey="key" listValue="value" name="employee.employeeState" value="employee.employeeState" ></s:select>


			</p>
		</div>
	
	
	<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>	
	</form>
</div>

